package com.fulu.game.bi.service.impl.auth.config;

import com.fulu.game.bi.entity.po.auth.BiUser;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.web.subject.support.WebDelegatingSubject;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class BiSubject extends WebDelegatingSubject {

    private String token;

    private BiUser currentUser;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public BiUser getCurrentUser() {
        return currentUser;
    }

    public void setCurrentUser(BiUser currentUser) {
        this.currentUser = currentUser;
    }

    @Override
    public BiUser getPrincipal() {
        return (BiUser) super.getPrincipal();
    }

    public BiSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, ServletRequest request, ServletResponse response, SecurityManager securityManager) {
        super(principals, authenticated, host, session, request, response, securityManager);
    }

    public BiSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, boolean sessionEnabled, ServletRequest request, ServletResponse response, SecurityManager securityManager) {
        super(principals, authenticated, host, session, sessionEnabled, request, response, securityManager);
    }
}
